
package com.e885.util;

/**
 * 有關檢查合法的 util 如:檢查字串是否為 null<br>
 * <br>
 * Copyright: Copyright (c) 2001-2008<br>
 * Company: E885 Group
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 */
public class ValidUtil
{
	/**
	 * 檢查是字串是否為 null
	 * 
	 * @param source
	 */
	public static void checkNull( Object source, Object name )
	{
		checkNull( new Object[][]
			{
				{ source, name } } );
	}

	/**
	 * 檢查是字串是否為 null
	 * 
	 * @param sources
	 */
	public static void checkNull( Object[][] sources )
	{
		int length = sources.length;

		for( int i = 0; i < length; i++ )
		{
			if( sources[ i ][ 0 ] == null )
				throw new IllegalStateException( sources[ i ][ 1 ] + " is null." );
		}
	}
}
